package com.oss.util.easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 读取excel监听器-无表头
 * 此类不能被spring管理，要每次读取excel都要new
 * @author chegnqiang
 */
@Data
@Slf4j
public class EasyExcelDataListenerNoHeader extends AnalysisEventListener<Map<Integer,String>> {
    // 行元素集合 , map的key=列号 , value=值
    List<Map<Integer,String>> dataList = new ArrayList<>();
    @Override
    public void invoke(Map<Integer,String> rowMap, AnalysisContext analysisContext) {
        dataList.add(rowMap);
    }
    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
    }
}
